package com.xuzhijie.pms.controller;


import com.xuzhijie.pms.common.Result;
import com.xuzhijie.pms.entity.Feedback;
import com.xuzhijie.pms.service.IFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 许志杰
 * @since 2024-02-17
 */
@RestController
@RequestMapping("/feedback")
public class FeedbackController {

    @Autowired
    private IFeedbackService iFeedbackService;

    @GetMapping("/page")
    public Result findPage(@RequestParam Integer page,
                           @RequestParam Integer size,
                           @RequestParam Integer progress,
                           @RequestParam Integer feedbackType,
                           @RequestParam Integer feedbackClassification,
                           @RequestParam Integer source) {

        return iFeedbackService.findPage(page, size,progress,feedbackType,feedbackClassification,source);
    }

    @PostMapping("/addSuggest")
    public Result addSuggestion(@RequestBody Map<String, Object> request){



        return iFeedbackService.addSuggestion(request);
    }

    @GetMapping("/feedbackInfoById")
    public Result feedbackInfoById(@RequestParam String feedbackId){
        Feedback byId = iFeedbackService.getById(feedbackId);

        return Result.success(byId);
    }

}

